﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.Configuration;

using openxml.butter.definition;
using openxml.butter.controller;

namespace OpenXmlWebBetter
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {
            string filePath = ConfigurationManager.AppSettings["VirginPath"];
            DocumentTemplate.VirginPath = filePath;

            //créer une webtemplatefactory
            WebTemplateFactory wtf = new WebTemplateFactory();
            String server = ConfigurationManager.AppSettings["wtf-server"]; //"http://localhost:8080/";

            wtf.SpecialTemplateUrl = server + ConfigurationManager.AppSettings["wtf-special-template"] ; //"studio/ruban.docx";
            wtf.UpdateUrl = server + ConfigurationManager.AppSettings["wtf-upload-url"]; //"fileaspx?code=";
            wtf.WebServiceUrl = server + ConfigurationManager.AppSettings["wtf-oxb-ws"]; // "service/webservice1.asmx";
            wtf.treeTemplateUrl = server + ConfigurationManager.AppSettings["tree-data-template-url"]; //treeTemplateView.aspx?code=

            Application["webtemplatefactory"] = wtf;
        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}